#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int my_strlen(char* st) {
	if (*st != 0)
		return 1 + my_strlen(st + 1);
	return 0;
}

void reverse(char* p) {
	//int left = 0;
	int right = my_strlen(p)-1;
	//char tmpe=NULL;
	////寻找重复操作
	//tmpe = p[left];
	//p[left] = p[right];
	//p[right] = '\0';
	//if(*(p+1)!='\0')
	//reverse(p + 1);
	//p[right]=tmpe;


	char tmpe = *p;
	*p = *(p + right);
	*(p + right) = '\0';
	if (*(p + 1) != '\0')
		reverse(p + 1);
	*(p + right) = tmpe;
}
int main() {
	char test[] = "a b c d e f g";
	reverse(test);
	printf("%s", test);
	return 0;
}
